﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Microsoft.Win32;

namespace XDLogonMonitor {
    class Registry {

        public Registry() { }

        static public Boolean ModifyRegistry(String remoteHost) {

            try {
                RegistryKey rkeyBase = Microsoft.Win32.RegistryKey.OpenRemoteBaseKey(RegistryHive.LocalMachine, remoteHost);
                RegistryKey systemPolicyKey = rkeyBase.OpenSubKey(
                    "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\policies\\system", true);

                systemPolicyKey.SetValue("legalnoticetext", "");
                return true;
            }
            catch (Exception e) {
                Console.Error.WriteLine(e.ToString());
                return false;   
            }
        }
    }
}
